package cc.wsyw126.java.jvm.CallOrder;

/**
 * Created by Administrator on 2017/4/14.
 */
public class CallOrder {
    public static void main(String[] args) {
        new RoundGlyph(5);
    }
}

class Glyph {

    void draw() {
        System.out.println("Glyph draw()");
    }

    Glyph() {
        System.out.println("Glyph before draw();");
        draw();
        System.out.println("Glyph after draw();");
    }
}

class RoundGlyph extends Glyph {
    private int radius = 1;

    RoundGlyph(int r) {
        radius = r;
        System.out.println("RoundGlyph(),radius:" + radius);
    }

    @Override
    void draw() {
        System.out.println("RoundGlyph.draw(),radius:" + radius);//此处打印是0，而不是1
    }
}
